.dx-size-default() {
    @GENERIC_TREEVIEW_CONTAINER_WITH_BORDER_OFFSET: 7px;

    @GENERIC_TREEVIEW_BORDER_PADDING: 1px;
    @GENERIC_TREEVIEW_CONTAINER_PADDING:
        @GENERIC_TREEVIEW_BORDER_PADDING
        @GENERIC_TREEVIEW_BORDER_PADDING
        @GENERIC_TREEVIEW_BORDER_PADDING
        @GENERIC_TREEVIEW_CONTAINER_WITH_BORDER_OFFSET;

    @GENERIC_TREEVIEW_NODE_OFFSET: 15px;

    @GENERIC_TREEVIEW_TOGGLE_ITEM_WIDTH: 21px;

    @GENERIC_TREEVIEW_ITEM_WITH_CHECKBOX_OFFSET: 36px;
    @GENERIC_SELECT_ALL_ITEM_OFFSET: 20px;

    @GENERIC_SELECT_ALL_ITEM_PADDING: 9px 0 11px @GENERIC_SELECT_ALL_ITEM_OFFSET;
    @GENERIC_SELECT_ALL_ITEM_LEFT_PADDING: 26px;

    @GENERIC_TREEVIEW_ITEM_PADDING: 5px 6px;
    @GENERIC_TREEVIEW_MIN_ITEM_HEIGHT: 32px;

    @GENERIC_TREEVIEW_CHECKBOX_OFFSET: 19px;

    @GENERIC_TREEVIEW_ITEM_VISIBILITY_ICON_SIZE: 10px;

    @GENERIC_TREEVIEW_LOADINCICATOR_OFFSET_TOP: 8px;
    @GENERIC_TREEVIEW_LOADINCICATOR_OFFSET_LEFT: -1px;
    @GENERIC_TREEVIEW_LOADINCICATOR_SIZE: 14px;
    @GENERIC_SELECT_ALL_TEXT_OFFSET: 31px;

    @GENERIC_TREEVIEW_ARROW_ICON_SIZE: 22px;
}

.dx-size-compact() {
    @GENERIC_TREEVIEW_CONTAINER_WITH_BORDER_OFFSET: 6px;

    @GENERIC_TREEVIEW_BORDER_PADDING: 1px;
    @GENERIC_TREEVIEW_CONTAINER_PADDING:
        @GENERIC_TREEVIEW_BORDER_PADDING
        @GENERIC_TREEVIEW_BORDER_PADDING
        @GENERIC_TREEVIEW_BORDER_PADDING
        @GENERIC_TREEVIEW_CONTAINER_WITH_BORDER_OFFSET;

    @GENERIC_TREEVIEW_NODE_OFFSET: 10px;

    @GENERIC_TREEVIEW_TOGGLE_ITEM_WIDTH: 16px;

    @GENERIC_TREEVIEW_ITEM_WITH_CHECKBOX_OFFSET: 31px;
    @GENERIC_SELECT_ALL_ITEM_OFFSET: 15px;

    @GENERIC_SELECT_ALL_ITEM_PADDING: 6px 0 8px @GENERIC_SELECT_ALL_ITEM_OFFSET;
    @GENERIC_SELECT_ALL_ITEM_LEFT_PADDING: 20px;

    @GENERIC_TREEVIEW_ITEM_PADDING: 4px 6px;
    @GENERIC_TREEVIEW_MIN_ITEM_HEIGHT: 28px;

    @GENERIC_TREEVIEW_CHECKBOX_OFFSET: 14px;

    @GENERIC_TREEVIEW_ITEM_VISIBILITY_ICON_SIZE: 8px;

    @GENERIC_TREEVIEW_LOADINCICATOR_OFFSET_TOP: 8px;
    @GENERIC_TREEVIEW_LOADINCICATOR_OFFSET_LEFT: -1px;
    @GENERIC_TREEVIEW_LOADINCICATOR_SIZE: 11px;
    @GENERIC_SELECT_ALL_TEXT_OFFSET: 26px;

    @GENERIC_TREEVIEW_ARROW_ICON_SIZE: 18px;
}

.dx-treeview-node-loadindicator {
    top: @GENERIC_TREEVIEW_LOADINCICATOR_OFFSET_TOP;
    left: @GENERIC_TREEVIEW_LOADINCICATOR_OFFSET_LEFT;
    width: @GENERIC_TREEVIEW_LOADINCICATOR_SIZE;
    height: @GENERIC_TREEVIEW_LOADINCICATOR_SIZE;
}

.dx-treeview {

    &.dx-treeview-border-visible {
        border: 1px solid @treeview-border-color;

        .dx-treeview-select-all-item {
            padding-left: @GENERIC_SELECT_ALL_ITEM_LEFT_PADDING;
        }

        .dx-scrollable-content {
            >.dx-treeview-node-container {
                padding: @GENERIC_TREEVIEW_CONTAINER_PADDING;
            }
        }
    }

    .dx-treeview-select-all-item {
        margin: 0 0 @GENERIC_TREEVIEW_CONTAINER_WITH_BORDER_OFFSET 0;
        border-bottom: 1px solid @treeview-border-color;
        padding: @GENERIC_SELECT_ALL_ITEM_PADDING;

        .dx-checkbox-text {
            padding-left: @GENERIC_SELECT_ALL_TEXT_OFFSET;
        }
    }

    .dx-treeview-node {
        padding-left: @GENERIC_TREEVIEW_NODE_OFFSET;

        &.dx-state-selected {
            > .dx-treeview-item {
                color: @treeview-item-selected-color;
            }
        }

        &.dx-treeview-item-with-checkbox {
            .dx-treeview-item {
                color: @base-text-color;
                padding-left: @GENERIC_TREEVIEW_ITEM_WITH_CHECKBOX_OFFSET;
            }

            .dx-checkbox {
                top: 5px;
                left: @GENERIC_TREEVIEW_CHECKBOX_OFFSET;
            }

            &.dx-state-focused {
                > .dx-checkbox .dx-checkbox-icon {
                    border: 1px solid @checkbox-focused-borderd-color;
                }
            }
        }

        &:not(.dx-treeview-item-with-checkbox) {
            &.dx-state-selected {
                > .dx-treeview-item {
                    color: @treeview-item-selected-color;
                    background-color: @treeview-item-selected-bg;
                }
            }

            &.dx-state-focused {
                > .dx-treeview-item {
                    background-color: @treeview-focused-bg;

                    * {
                        color: @treeview-focus-color;
                    }
                }
            }
        }
    }

    .dx-treeview-item {
        padding: @GENERIC_TREEVIEW_ITEM_PADDING;
        min-height: @GENERIC_TREEVIEW_MIN_ITEM_HEIGHT;

        .dx-icon {
            .dx-icon-sizing(@GENERIC_BASE_ICON_SIZE);
        }

        &.dx-state-hover {
            background-color: @treeview-hover-bg;
            color: @treeview-item-hover-color;
        }
    }

    .dx-treeview-toggle-item-visibility {
        .dx-icon-spinright;
        .dx-icon-font-centered-sizing(@GENERIC_TREEVIEW_ARROW_ICON_SIZE);
        color: @treeview-spin-icon-color;
        width: @GENERIC_TREEVIEW_TOGGLE_ITEM_WIDTH;
        height: @GENERIC_TREEVIEW_MIN_ITEM_HEIGHT;
        top: 0;
        left: -4px;

        &.dx-treeview-toggle-item-visibility-opened {
            .dx-icon-spindown;
            .dx-icon-font-centered-sizing(@GENERIC_TREEVIEW_ARROW_ICON_SIZE);
        }
    }

    &.dx-rtl {
        .dx-treeview > .make-rtl(@GENERIC_TREEVIEW_CONTAINER_WITH_BORDER_OFFSET, @GENERIC_TREEVIEW_NODE_OFFSET, @GENERIC_TREEVIEW_ITEM_WITH_CHECKBOX_OFFSET, @GENERIC_TREEVIEW_CHECKBOX_OFFSET, @GENERIC_SELECT_ALL_TEXT_OFFSET, @GENERIC_SELECT_ALL_ITEM_LEFT_PADDING, @GENERIC_TREEVIEW_BORDER_PADDING);

        .dx-treeview-toggle-item-visibility {
            right: -4px;
        }

        .dx-treeview-item-with-checkbox .dx-checkbox {
            overflow: visible;
        }
    }
}
